home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Know Your Baseball - The Greatest Player Resource
/
Know Your Baseball - Greatest Player.iso
/
Baseball
/
Director
/
KTGCST.CST
/
00063_Script_ButtonKit
< prev
next >
Wrap
Text File
|
1998-09-21
|
7KB
|
268 lines
------------------ Init List For Button State Tracking --------------------
-- called from on startmovie or the first exitframe script in the movie
-- loads a default list of 0
-- the list is used by ButtonKit to set the positions to 1 to
-- track which buttons are on or off
global gButtonState,gHion,gOpning
on initButtonKit
set gButtonState = []
repeat with x = 1 to 48
append gbuttonState,0
end repeat
end
------------------- Three State Button --------------------------------------
-- if a button has three states then call ThreeStateButton as the first line in any scripts
-- that are attached to the button
on ThreeStateButton
set mybutton = the clickon
set one = getat(gbuttonState, mybutton)
if one = 0 then
set the membernum of sprite mybutton = the membernum of sprite mybutton +1
setat(gbuttonState, mybutton,2)
end if
end
-- for balls in the field
on ThreeStateBall
set mybutton = the clickon
set one = getat(gbuttonState, mybutton)
if one = 0 then
set the membernum of sprite mybutton = the membernum of sprite mybutton +1
setat(gbuttonState, mybutton,2)
setat(gbuttonState, (mybutton-20),2)
end if
loadaudiomedia (mybutton)
end
--- for Roles
on ThreeStatePlayers
set mybutton = the clickon
set one = getat(gbuttonState, mybutton)
if one = 0 then
set the membernum of sprite mybutton = the membernum of sprite mybutton +1
setat(gbuttonState, mybutton,2)
end if
-- loadaudiomedia(mybutton)
end
--- for balls in roles where the players have threestates
on ThreeStateBallR
set gOpning = EMPTY
set mybutton = the clickon
set one = getat(gbuttonState, mybutton)
if one = 0 then
set the membernum of sprite mybutton = the membernum of sprite mybutton +1
set player = mybutton-20
set the membernum of sprite player = the membernum of sprite player +1
setat(gbuttonState, mybutton,2)
setat(gbuttonState, (player),2)
end if
loadAudioMedia(mybutton)
end
on ThreeStateBallRg
set gOpning = EMPTY
set mybutton = the clickon
set one = getat(gbuttonState, mybutton)
if one = 0 then
set the membernum of sprite mybutton = the membernum of sprite mybutton +1
setat(gbuttonState, mybutton,2)
end if
loadAudioMedia(mybutton)
end
on TwoStateField
set gOpning = EMPTY
set mybutton = the clickon+10
set one = getat(gbuttonState, mybutton)
if one = 0 then
setat(gbuttonState, (mybutton,1)
set the membernum of sprite mybutton = the membernum of sprite mybutton+1
set the blend of sprite mybutton = 100
end if
loadAudioMedia(mybutton)
end
-------------------------- Two State Buttons --------------------------
on TwoStateField2
set gOpning = EMPTY
set mybutton = the clickon+6
set one = getat(gbuttonState, mybutton)
if one = 0 then
setat(gbuttonState, (mybutton,1)
set the membernum of sprite mybutton = the membernum of sprite mybutton+1
set the blend of sprite mybutton = 100
end if
loadAudioMedia(mybutton)
end
on TwoStateButton
set gOpning = EMPTY
set mybutton = the clickon
setat(gButtonState,mybutton,1)
end
------------------------- Reset Button States -----------------------------------
-- toggles off any button that any ready on
-- these scripts are placed in the second line of a button handler
-- after ThreeStateButton or twostatebutton
-- they are divided into groups attach the correct group to you handler
on resetBalls
set mybutton = the clickon
repeat with y = 31 down to 25
set thisone = getat(gbuttonState,y)
if thisone > 0 and y <> mybutton then
set the blend of sprite y = 0
set the blend of sprite y-20 = 0
set the membernum of sprite y = the membernum of sprite y -1
setat(gbuttonState,y,0)
setat(gbuttonState,y-20,0)
exit repeat
end if
end repeat
updatestage
end
on resetBallsR
set mybutton = the clickon
repeat with y = 31 down to 25
set thisone = getat(gbuttonState,y)
if thisone > 0 and y <> mybutton then
set the blend of sprite y = 0
set the blend of sprite y-20 = 0
set the membernum of sprite y = the membernum of sprite y -1
set player = y-20
set the membernum of sprite player = the membernum of sprite player -1
setat(gbuttonState,y,0)
setat(gbuttonState,player,0)
exit repeat
end if
end repeat
updatestage
end
on resetField
set mybutton = (the clickon)+10
repeat with y = 31 down to 25
set thisone = getat(gbuttonState,y)
if thisone > 0 and y <> mybutton then
set the blend of sprite y = 0
set the blend of sprite y-20 = 0
set the membernum of sprite y = the membernum of sprite y-1
setat(gbuttonState,y,0)
setat(gbuttonState,y-20,0)
exit repeat
end if
end repeat
updatestage
end
on resetField2
set mybutton = (the clickon)+6--for the edges in field defence
repeat with y = 31 down to 25
set thisone = getat(gbuttonState,y)
if thisone > 0 and y <> mybutton then
set the blend of sprite y = 0
set the blend of sprite y-20 = 0
set the membernum of sprite y = the membernum of sprite y-1
setat(gbuttonState,y,0)
setat(gbuttonState,y-20,0)
exit repeat
end if
end repeat
updatestage
end
--- attach to buttons
on resetsweater
set mybutton = the clickon
repeat with y = 38 down to 34
set thisone = getat(gbuttonState,y)
if thisone > 0 and y <> mybutton then
set the blend of sprite y = 0
set the membernum of sprite y = the membernum of sprite y -1
setat(gbuttonState,y,0)
exit repeat
end if
end repeat
updatestage
end
on resetbanner
set mybutton = the clickon
repeat with y = 47 down to 39
set thisone = getat(gbuttonState,y)
if thisone > 0 and y <> mybutton then
set the blend of sprite y = 0
set the membernum of sprite y = the membernum of sprite y -1
setat(gbuttonState,y,0)
exit repeat
end if
end repeat
end
on resetbannerAlt b -- alternate to mouseup script in rules
global gRbook
case gRBook of
"soccer":
set mybutton = 40
"micro":
set mybutton = b
end case
put mybutton
repeat with y = 47 down to 39
set thisone = getat(gbuttonState,y)
if thisone > 0 and y <> mybutton then
set the blend of sprite y = 0
set the membernum of sprite y = the membernum of sprite y -1
setat(gbuttonState,y,0)
exit repeat
end if
end repeat
updatestage
end
-- for rules
on resettabs1
set mybutton = the clickon
put mybutton
repeat with y = 33 down to 30
set thisone = getat(gbuttonState,y)
if thisone > 0 and y <> mybutton then
set the blend of sprite y = 0
setat(gbuttonState,y,0)
exit repeat
end if
end repeat
updatestage
end
on resettabs2
set mybutton = the clickon
put mybutton
repeat with y = 37 down to 34
set thisone = getat(gbuttonState,y)
if thisone > 0 and y <> mybutton then
set the blend of sprite y = 0
setat(gbuttonState,y,0)
exit repeat
end if
end repeat
updatestage
end